var mxClipboard =
{
	STEPSIZE: 10,
	insertCount: 1,
	cells: null,
	isEmpty: function()
	{
		return mxClipboard.cells == null;
	},
	cut: function(graph, cells)
	{
		cells = mxClipboard.copy(graph, cells);
		mxClipboard.insertCount = 0;
		mxClipboard.removeCells(graph, cells);
		return cells;
	},
	removeCells: function(graph, cells)
	{
		graph.removeCells(cells);
	},
	copy: function(graph, cells)
	{
		cells = cells || graph.getSelectionCells();
		var result = graph.getExportableCells(cells);
		mxClipboard.insertCount = 1;
		mxClipboard.cells = graph.cloneCells(result);
		return result;
	},
	paste: function(graph)
	{
		if (mxClipboard.cells != null)
		{
			var cells = graph.getImportableCells(mxClipboard.cells);
			var delta = mxClipboard.insertCount * mxClipboard.STEPSIZE;
			var parent = graph.getDefaultParent();
			cells = graph.importCells(cells, delta, delta, parent);
			mxClipboard.insertCount++;
			graph.setSelectionCells(cells);
		}
	}
};
var mxObjectIdentity =
{
	FIELD_NAME: 'mxObjectId',
	counter: 0,
	get: function(obj)
	{
		if (typeof (obj) == 'object' && obj[mxObjectIdentity.FIELD_NAME] == null)
		{
			var ctor = mxUtils.getFunctionName(obj.constructor);
			obj[mxObjectIdentity.FIELD_NAME] = ctor + '#' + mxObjectIdentity.counter++;
		}
		return obj[mxObjectIdentity.FIELD_NAME];
	},
	clear: function(obj)
	{
		if (typeof (obj) == 'object')
		{
			delete obj[mxObjectIdentity.FIELD_NAME];
		}
	}
};

function mxDictionary()
{
	this.clear();
};
mxDictionary.prototype.map = null;
mxDictionary.prototype.clear = function()
{
	this.map = {};
};
mxDictionary.prototype.get = function(key)
{
	var id = mxObjectIdentity.get(key);
	return this.map[id];
};
mxDictionary.prototype.put = function(key, value)
{
	var id = mxObjectIdentity.get(key);
	var previous = this.map[id];
	this.map[id] = value;
	return previous;
};
mxDictionary.prototype.remove = function(key)
{
	var id = mxObjectIdentity.get(key);
	var previous = this.map[id];
	delete this.map[id];
	return previous;
};
mxDictionary.prototype.getValues = function()
{
	var result = [];

	for (key in this.map)
	{
		result.push(key);
	}
	return result;
};
mxDictionary.prototype.getValues = function()
{
	var result = [];

	for (key in this.map)
	{
		result.push(this.map[key]);
	}
	return result;
};